#include <iostream>
#include <string>
// 代理模式

class RentHouse
{
public:
    virtual void renthouse() = 0;
};

class Landlord : public RentHouse
{
public:
    void renthouse() override
    {
        std::cout << "将房子租出去" << std::endl;
    }
};

class Mediator : public RentHouse
{
public:
    void renthouse() override
    {
        std::cout << "张贴租房告示" << std::endl;
        std::cout << "带人来看房" << std::endl;
        landlord.renthouse();
        std::cout << "负责租房售后" << std::endl;
    }

private:
    Landlord landlord;
};

int main()
{
    Mediator m;
    m.renthouse();
    return 0;
}